package com.wangzhixuan.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import org.springframework.web.multipart.MultipartFile;

import com.wangzhixuan.mapper.ApplyInFoMapper;
import com.wangzhixuan.model.ApplyInFo;
import com.wangzhixuan.service.DaoRuService;
import com.wangzhixuan.utils.ReadExcel2;


	

@Service
public class DaoRuServiceImpl implements DaoRuService {

	@Autowired
	ApplyInFoMapper applyInFoService;
	
	

	public String readExcelFile(MultipartFile file) {
		String result = "";
		// 创建处理EXCEL的类
		ReadExcel2 readExcel = new ReadExcel2();
		// 解析excel，获取上传的事件单
		List<ApplyInFo> list = readExcel.getExcelInfo(file);
		applyInFoService.add(list);
		if (list != null && !list.isEmpty()) {
			result = "1";
		} else {
			result = "0";
		}
		return result;
	}
	
	

}
